package com.lichuang.fruitvarietysm.goods.mapper;

import com.lichuang.fruitvarietysm.goods.entity.GoodsEvaluate;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lichuang.fruitvarietysm.goods.vo.EvaluateAndAppend;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 商品评价表 Mapper 接口
 * </p>
 *
 * @author shuaihang
 * @since 2019-06-16
 */
@Repository
public interface GoodsEvaluateMapper extends BaseMapper<GoodsEvaluate> {

    //根据查询评价表的信息后：根据订单id查订单表中的skuId
    int getOrderSkuId(@Param("order_no")Long order_no);
    //然后根据skuId,查找具体的sku的表中的skuValue的值
    String getSkuValue(@Param("sku_id")Integer sku_id);
    //根据评论表中的userId，查具体的username
    String getUserName(@Param("user_id")Integer user_id);


    //查看追加评论。根据追加商品表的商品id
    List<EvaluateAndAppend> getEvaluateAppend(@Param("goods_id")Integer goods_id);
}
